package com.jyl.dp;

/**
 * 1. 暴力递归破解
 * 时间复杂度：O(2的n次方)
 * @ClassName Recursion
 * @Author admin
 * @Date 2024/6/15
 */
public class Recursion {

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            System.out.println(i + "==" + getFn(i));
        }
    }

    protected static int getFn(int inputNum) {
        if (inputNum == 0) {
            return 0;
        }

        if (inputNum == 1) {
            return 1;
        }

        return getFn(inputNum - 1) + getFn(inputNum - 2);
    }

}
